package com.soulmate.api.stock;

import com.soulmate.api.stock.dto.StockDTO;
import com.soulmate.exception.BusinessException;

/**
 * 库存服务
 *
 * @author huaiping
 * @date 2023/02/22
 */
public interface StockService {
    /**
     * 扣除
     *
     * @param productId   产品id
     * @param deductCount 扣除数
     * @return {@link StockDTO}
     * @throws BusinessException 业务异常
     */
    StockDTO deduct(Long productId, Integer deductCount) throws BusinessException;
}
